home *** CD-ROM | disk | FTP | other *** search
INI File | 2001-09-10 | 1.1 KB | 48 lines |
- [Name]
- NumberKeys - Use with keyboardEvent to poll numbers
- By Matthew Peterson, matthew@pinoko.berkeley.edu
-
- [Description]
- 2-19-2000
- Place this behavior in the same sprite as the KeyboardEvent
- behavior to have the following numbers and symbols polled:
- 0123456789:.-,
-
- [Parameters]
-
- [200072 MP_KBNumeric]
- GlobalVars whichkeyN whichkeyC IsCap
- //Use with KeyboardEvent Behavior.
- //Numbers and symbols uses with numbers
- //Returns the ascii of the character.
- IF(KeyIsDown(kNone,'0'))
- whichkeyN = 48
- ELSEIF(KeyIsDown(kNone,'1'))
- whichkeyN = 49
- ELSEIF(KeyIsDown(kNone,'2'))
- whichkeyN = 50
- ELSEIF(KeyIsDown(kNone,'3'))
- whichkeyN = 51
- ELSEIF(KeyIsDown(kNone,'4'))
- whichkeyN = 52
- ELSEIF(KeyIsDown(kNone,'5'))
- whichkeyN = 53
- ELSEIF(KeyIsDown(kNone,'6'))
- whichkeyN = 54
- ELSEIF(KeyIsDown(kNone,'7'))
- whichkeyN = 55
- ELSEIF(KeyIsDown(kNone,'8'))
- whichkeyN = 56
- ELSEIF(KeyIsDown(kNone,'9'))
- whichkeyN = 57
- ELSEIF(KeyIsDown(kShiftKey,';'))
- whichkeyN = 58
- ELSEIF(KeyIsDown(kNone,'-'))
- whichkeyN = 45
- ELSEIF(KeyIsDown(kNone,','))
- whichkeyN = 44
- ELSEIF(KeyIsDown(kNone,'.'))
- whichkeyN = 46
- ENDIF
-
-